/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bimager.jtwain.ui;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;
import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 *
 * @author Amskape
 */
public class LoadingPopup extends JPanel{
    Image loadingImage;

    public LoadingPopup(Image loadingImage) {
        this.loadingImage = loadingImage;
    }

    public LoadingPopup() {
    }

    public Image getLoadingImage() {
        return loadingImage;
    }

    public LoadingPopup(LayoutManager layout) {
        super(layout);
    }

    public LoadingPopup(Image loadingImage, LayoutManager layout, boolean isDoubleBuffered) {
        super(layout, isDoubleBuffered);
        this.loadingImage = loadingImage;
    }

    public LoadingPopup(LayoutManager layout, boolean isDoubleBuffered) {
        super(layout, isDoubleBuffered);
    }

    public LoadingPopup(Image loadingImage, boolean isDoubleBuffered) {
        super(isDoubleBuffered);
        this.loadingImage = loadingImage;
    }

    public LoadingPopup(Image loadingImage, LayoutManager layout) {
        super(layout);
        this.loadingImage = loadingImage;
    }

    public LoadingPopup(boolean isDoubleBuffered) {
        super(isDoubleBuffered);
    }

    public void setLoadingImage(Image loadingImage) {
        this.loadingImage = loadingImage;
    }

    @Override
    public void setPreferredSize(Dimension preferredSize) {
        preferredSize.width = 200;
        preferredSize.height = 200;
        super.setPreferredSize(preferredSize); //To change body of generated methods, choose Tools | Templates.
        
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g); //To change body of generated methods, choose Tools | Templates.
        g.drawImage(loadingImage, 0, 0, this);
        
    }
    
}
